<!--
CREATE TABLE [dbo].[Customer](
	[custid] [nchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[custname] [nchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[description] [nchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
-->

<%@page import="com.aptech.dto.Customer" %>
<%
    java.util.List custList = com.aptech.business.CustomerBusiness.getCustomerList("");
%>

<form>
    <b>Select a country:</b>&nbsp;
    <select name="sel">
        <option value=""><---Select---></option>
        <%for (int i=0; i < custList.size(); i++) {%>
        <option value="<%=((Customer)custList.get(i)).getCustName()%>">
            <%=((Customer)custList.get(i)).getCustId()%>(<%=((Customer)custList.get(i)).getCustName()%>)
        </option>
        <%}%>
    </select>

    <input type="submit" value="Submit">
</form>
<%
            String sel = request.getParameter("sel");
            String msg = "<font color = 'blue'>You have selected item '" + sel + "'</font>";
            if (sel == null || sel.equals("")) {
                msg = "<font color = 'red'>You haven't selected any item</font>";
            }
%>
<br/><%=msg%>